//
//  DifferentKeyModel.m
//  ReviewDemo
//
//  Created by 龙 on 2018/3/22.
//  Copyright © 2018年 long. All rights reserved.
//

#import "DifferentKeyModel.h"
#import <objc/runtime.h>

static NSMutableDictionary *map = nil;

@implementation DifferentKeyModel

+ (void)load
{
    map = [NSMutableDictionary dictionary];
    
    map[@"name1"] = @"name";
    map[@"status1"] = @"status";
    map[@"name2"] = @"name";
    map[@"status2"] = @"status";
}


//不同字段映射到MyObject相同属性上
- (void)setDataWithDic:(NSDictionary *)dic
{
    [dic enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) {
        
//        NSString *propertyKey = [self propertyForKey:key];
//        if (propertyKey)
//        {
//            objc_property_t property = class_getProperty([self class], [propertyKey UTF8String]);
//            // TODO: 针对特殊数据类型做处理
//            NSString *attributeString = [NSString stringWithCString:property_getAttributes(property) encoding:NSUTF8StringEncoding];
//            [self setValue:obj forKey:propertyKey];
//        }
    }];
}


@end


